#include "widget.h"
#include "ui_widget.h"

#include<QPushButton>


Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

   mybutton =new QPushButton(this);
   mybutton->setText("按钮");

   connect(mybutton,&QPushButton::clicked,this,&Widget::handclick);

}

Widget::~Widget()
{
    delete ui;
}

void Widget::handclick()
{
   if(mybutton->text() == QString("按钮"))
   {
       mybutton->setText("按下按钮");
   }
   else {
       mybutton->setText("按钮");
   }
}


